<template>
<div>
  <el-button type="primary" size="small" @click="dialogFormVisible = true">添加商店</el-button>

   <el-dialog title="新增商店" :visible.sync="dialogFormVisible">
        <el-form :model="form">
          <el-form-item label="商店名" :label-width="formLabelWidth">
            <el-input v-model="form.shop_name" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="图片地址" :label-width="formLabelWidth">
            <el-input v-model="form.shop_src" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="图片地址" :label-width="formLabelWidth">
            <el-input v-model="form.shop_src" autocomplete="off"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="addShop()">确 定</el-button>
        </div>
      </el-dialog>
</div>

  
</template>

<script>
export default {
    data(){
        return{
            dialogFormVisible:false,
            form:{
                shop_name:'',
                shop_src:'',
                
            },
            formLabelWidth:30,
        }
    },
    methods:{
        addShop(){
            this.$axios.post('/addShop',this.form).then(successResponse=>{
                this.$message({message:"添加成功",type:'success'})
            })
        }
    }

}
</script>

<style>

</style>